package com.ddone.sms.config;

import lombok.Data;
import lombok.Getter;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @author ddone
 * @date 2024/4/15-18:26
 */
@Component
@Data
@ConfigurationProperties(prefix = "aliyun.sms")
public class SmsProperties implements InitializingBean {
    private  String appSecret;
    private  String appCode;
    private  String host;
    private  String path;
    private  String method;
    private  String templateId;
    private  String smsSignId;

    public static String APP_SECRET;
    public static String APP_CODE;
    public static String HOST;
    public static String PATH;
    public static String METHOD;
    public static String TEMPLATE_ID;
    public static String SMS_SIGN_ID;

    @Override
    public void afterPropertiesSet() throws Exception {
        APP_SECRET = appSecret;
        APP_CODE = appCode;
        HOST = host;
        PATH = path;
        METHOD = method;
        TEMPLATE_ID = templateId;
        SMS_SIGN_ID = smsSignId;
    }
}
